
#ifndef __gui_inputH__
#define __gui_inputH__

#include "gui_window.h"

namespace WtfGui {
	class Dialog: public Window {
		Widgets::Label::tRef		mrLblCaption;
		tChildList					mElements;
		WidgetContainer::tRef		mButtons;

		WtfEngine::Functor::tRef	mrCallback;

	public:
		typedef enum {
			BTN_NONE = 0,
			BTN_OK,
			BTN_CANCEL,
			BTN_YES,
			BTN_NO
		} tButton;

		typedef enum {
			BTNS_OK = 0,
			BTNS_OKCANCEL,
			BTNS_YESNO,
			BTNS_YESNOCANCEL
		} tButtonSet;

		typedef enum {
			DIALOG_BASIC = 0,
			DIALOG_INFO,
			DIALOG_ORDER,
			DIALOG_QUESTION,
			DIALOG_WARNING,
			DIALOG_ERROR
		} tDialogType;

	private:
		tButton	mClickedButton;

	public:
		Dialog(const WtfEngine::String& sCaption, const WtfEngine::String& sTitle = "", tButtonSet btns = BTNS_OK,
			tDialogType type = DIALOG_BASIC, const Window::tRef& rWndParent = Window::tRef());

		virtual void DialogButtonCallback(tButton btn);

		inline void setCallback(const WtfEngine::Functor::tRef& rCallback) {
			mrCallback = rCallback;
		};

		inline tButton getButton() const {
			return mClickedButton;
		};

		void AddChild(const Widget::tRef& rChild) {
			Window::AddChild(rChild);
			mElements.push_back(rChild);
		};

		virtual void OnClose();

		GC_AUTOSIZE(Dialog);
	};

	class InputDialog: public Dialog {

	};
};

#endif
